// app.js

App({
  
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
  },
  getLocationInfo: function(cb){
    var that = this;
    if(this.globalData.locationInfo){
        cb(this.globalData.locationInfo)
    }else{
        wx.getLocation({
            type: 'gcj02', // 默认为 wgs84 返回 gps 坐标，gcj02 返回可用于 wx.openLocation 的坐标
            success: function(res){
                that.globalData.locationInfo = res;
                cb(that.globalData.locationInfo)
            },
            fail: function() {
                // fail
            },
            complete: function() {
                // complete
            }
        })
    }
} ,
globalData: {
    userInfo: null,
    imagesUrl:"https://src.darlingchinese.com/xcx/",
    locationInfo: null,
}
})
